import config from './config'
import i18n from "./locales"
import api from './api'
import { message } from 'ant-design-vue'

import * as antIcons from '@ant-design/icons-vue'
import * as bkIcons from './assets/icons'

export default {
    install(app) {
        //挂载全局对象
		app.config.globalProperties.$config = config;
		app.config.globalProperties.$i18n = i18n;
        app.config.globalProperties.$t = i18n.t;
		app.config.globalProperties.$api = api;
		app.config.globalProperties.$message = message;

        //统一注册ant-icon图标
		for(let icon in antIcons){
			app.component(`AntIcon${icon}`, antIcons[icon])
		}
		//统一注册sc-icon图标
		for(let icon in bkIcons){
			app.component(`BkIcon${icon}`, bkIcons[icon])
		}
		
        //关闭async-validator全局控制台警告
		window.ASYNC_VALIDATOR_NO_WARNING = 1
    }
}